<!DOCTYPE html>
<html xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<h:head>
	<link href="resources/styles/main.css" rel="stylesheet" type="text/css" />
</h:head>

<f:event type="preRenderView" listener="#{lessonTypeViewBean.init}" />

<h:body>
	<p:ajaxStatus onstart="statusDialog.show();"
		onsuccess="statusDialog.hide();" />
	<p:dialog modal="true" widgetVar="statusDialog" header="#{msg.loading}"
		draggable="false" closable="false">
		<p:graphicImage value="/resources/img/ajaxloadingbar.gif" />
	</p:dialog>
	<f:view locale="#{language.localeCode}" />
	<div id="container">
		<div id="header">
			<ui:include src="/query.xhtml">
				<ui:param name="title" value="#{msg.lessontype}" />
				<ui:param name="bean" value="#{lessonTypeViewBean}" />
			</ui:include>
		</div>
		<div id="content">
			<h:form id="lessontypeform">

				<p:dataTable var="rec" rowKey="#{rec.id}" paginator="true" rows="5"
					value="#{lessonTypeViewBean.lessonTypes}"
					selection="#{lessonTypeViewBean.selectedLessonType}" id="lessontypeTable"
					rowsPerPageTemplate="5,10,15,25,50,100"
					emptyMessage="#{msg.norecordsfound}">>

					<f:facet name="header">  
            #{msg.llessontype} (#{lessonTypeViewBean.length}) 
        </f:facet>
        <p:ajax event="sort"
                            listener="#{lessonTypeViewBean.caseListSortListner}" update=":lessontypeform:lessontypeTable" />
					<p:column selectionMode="single" style="width:18px" />
					<p:ajax event="rowSelect"
						listener="#{lessonTypeViewBean.onRowSelect}"
						update=":lessontypeform" />
					<p:column headerText="ID" sortBy="#{rec.id}" filterBy="#{rec.id}"
						id="id">  
            #{rec.id}  
        </p:column>
					<p:column headerText="Name" sortBy="#{rec.name}"
						filterBy="#{rec.name}" id="name">  
            #{rec.name}  
        </p:column>
					<p:column headerText="Modified" sortBy="#{rec.modified}"
						filterBy="#{rec.modified}" id="modified">  
            #{rec.modified}  
        </p:column>
					<p:column headerText="Created" sortBy="#{rec.created}"
						filterBy="#{rec.created}" id="created">  
            #{rec.created}  
        </p:column>
				</p:dataTable>
			</h:form>

		</div>
		<div id="footer">
			<ui:include src="/footer.xhtml" />
		</div>
	</div>
</h:body>
</html>